package com.xinxin.intelligenceexam.studyMenu.shortcut;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.xinxin.intelligenceexam.R;
import com.xinxin.intelligenceexam.utils.ToastUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/*参考github：
*
* */
public class ShortCutActivity extends AppCompatActivity {

    @BindView(R.id.btn_create)
    Button mBtnCreate;
    @BindView(R.id.btn_remove)
    Button mBtnRemove;
    @BindView(R.id.btn_check)
    Button mBtnCheck;
    @BindView(R.id.textView)
    TextView mTextView;
    @BindView(R.id.btn_static)
    Button mBtnStatic;
    @BindView(R.id.btn_dynamic)
    Button mBtnDynamic;
    @BindView(R.id.activity_short_cut)
    LinearLayout mActivityShortCut;

    Context mContext;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_short_cut);
        ButterKnife.bind(this);
        mContext = this;
    }

    @OnClick({R.id.btn_create, R.id.btn_remove, R.id.btn_check, R.id.btn_static, R.id.btn_dynamic})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_create:
                ShortCutUtils.createShortCut(mContext);
                break;
            case R.id.btn_remove:
                ShortCutUtils.delShortcut(mContext);
                break;
            case R.id.btn_check:
                ToastUtils.showShort(ShortCutUtils.isInstallShortcut(mContext,ShortCutUtils.getApplicationName(mContext))+"");
                break;
            case R.id.btn_static:
                break;
            case R.id.btn_dynamic:
                break;
        }
    }
}
